package org.huang.mybatis.demo.controller;

import com.github.pagehelper.PageInfo;
import org.huang.mybatis.demo.model.AuthUser;
import org.huang.mybatis.demo.service.AuthUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @描述：AuthUserController类描述
 * @作者: huanganwei
 * @创建时间: 2018-11-13 00:17:20
 * @版本: 1.0
 */
@RestController
@RequestMapping("/")
public class AuthUserController {

    @Autowired
    private AuthUserService authUserService;

    @GetMapping("/getUsers")
    public List<AuthUser> listAll(){
        return authUserService.listAll();
    }

    @GetMapping("/getUsers/{pageNum}/{pageSize}")
    public PageInfo<AuthUser> listAll(@PathVariable int pageNum, @PathVariable int pageSize){
        return authUserService.findAllUser(pageNum,pageSize);
    }
}
